package com.hdax.dao;

import com.hdax.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hdax.vo.PermissionVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 权限表 Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2021-03-22
 */
@Repository

public interface PermissionMapper extends BaseMapper<Permission> {
    List<PermissionVo> selectAllPermisson();
    List<Integer> getPermissionId(Integer roleId);
    void deleteByRid(@Param("roleId") Integer roleId);
    int addPermission(@Param("roleId")Integer roleId,@Param("permissions")List<Integer> permissions);
    int selectCountById(Integer id);
    List<Permission> findParentByRoleId(Integer roleId);
    List<Permission> findChildrenByRoleId(@Param("parent")Integer parent,@Param("roleId") Integer roleId);

}
